< previous page page_423 next page >

Page 423
different cursor styles. All the different screen fonts available on your system can be queried through the Screen object. Table 21.4 lists the most important properties of this system object.
Examples Filename: ObjScreen.frm
Table 21.4 Screen Object Properties.
PropertyDescription
ActiveFormThis property is dynamically changed at runtime whenever you move from one form to another. This property will hold a reference to the currently active form in your application.
ActiveControlThis property is dynamically changed at runtime to return a pointer to the control on the active form that has focus. This is very useful for performing a copy and paste routine from a toolbar, for example.
FontCountThis property returns the number of fonts installed on your computer.
FontsThis property is an array of all the available font names installed on your computer.
HeightThis property returns the total height of your screen area in a unit of measure called twips. (Twips will be explained in the next section.)
MousePointerYou can set this property to one of several constants to change how the mouse pointer looks in your application. For example, you use this to change the mouse pointer to an hourglass if the application is performing an operation that might take awhile.
TwipsPerPixelXThis property returns the number of twips per pixel on the horizontal axis.
TwipsPerPixelYThis property returns the number of twips per pixel on the vertical axis.
WidthThis property returns the total width of your screen area in a unit of measure called twips. (Twips will be explained in the next section.)

Twips
Visual Basic uses a unit of measure called twips. There are 1,440 twips per inch. Twips are used because this unit of measure will not change, regardless of what kind of monitor your application is run on. To determine what the resolution of your monitor is, you can run the following code:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdXY_Click()
   With Screen

 
< previous page page_423 next page >

If you like this book, buy it!